package com.geek.javase.wcy02;

import java.util.Scanner;

/**
 * @author wangchaoyang
 * @desc TODO
 * @date 2025/9/2
 */
public class SwithDemo {
    public static void main(String[] args) {
        while (true) {
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入分数：");
            double s = scanner.nextDouble();
            int d1 = 0;
            if (s == 100) {
                d1 = 1;
            } else if (s < 100 && s >= 90) { // 修正elseif为else if，并移除多余的分号
                d1 = 2;
            } else if (s < 90 && s >= 80) {
                d1 = 3;
            } else if (s < 80 && s >= 70) {
                d1 = 4;
            } else if (s < 70 && s >= 60) {
                d1 = 5;
            } else if (s < 60) {
                d1 = 6;
            }
            switch (d1) {
                case 1:
                    System.out.println("A级");
                    break;
                case 2:
                    System.out.println("A级");
                    break;
                case 3:
                    System.out.println("B级");
                    break;
                case 4:
                    System.out.println("C级");
                    break;
                case 5:
                    System.out.println("D级");
                    break;
                case 6:
                    System.out.println("不合格");
                    break;
            }
        }
    }
}